﻿@model LeEdu.MODEL.Group


@{
    ViewBag.Title = "GroupSearchTopic";
    Layout = "~/Views/Shared/_Index.cshtml";

}

<div id="content-container" class="container">
    <div class="group-header">

        <div class="group-header-inner" style="background: url(http://localhost:5130/Img/@Model.GBACKGROUND); background-repeat: no-repeat; background-size: 100% 100%; ">
            <div class="media">
                <div class="media-left">
                    <a href="/Group/GroupHomepage/@Model.GroupID">
                        <img src="http://localhost:5130/Img/@Model.GLOGO" alt="@Model.GNAME" class="avatar-square-sm">
                    </a>
                </div>
                <div class="media-body">
                    <h2 class="media-heading">@Model.GNAME</h2>
                    <div class="media-metas">
                        @((Model.UserAndGroup).Count )个成员
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            <h2 class="panel-title">话题搜索</h2>
            <form class="form-inline more hidden-xs" style="top:7px" action="/Group/GroupSearchTopic" method="post">
                <div class="input-group group-search">
                    <input id="Hidden1" type="hidden" name="id" value="@Model.GroupID" />
                    <input class="form-control" placeholder="组内搜索" name="TTITLE" type="text">
                    <span class="input-group-btn">
                        <button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-search"></span></button>
                    </span>
                </div>
            </form>
        </div>
        <div class="panel-body">
            @if (ViewBag.tops != null) {
                foreach (var item in ViewBag.tops as List<LeEdu.MODEL.Topicshi>) {
                    <ul>
                        <li class="media">
                            <a class="pull-left js-user-card" href="" data-card-url="/user/4/card/show" data-user-id="4">
                                <img class="avatar-md" src="http://localhost:5130/Img/@item.Users.Avatar">
                            </a>

                            <div class="media-body">
                                <div class="media-heading">
                                    @if (item.TATTRIBUTE != null && item.TATTRIBUTE.Contains("置顶")) {
                                        <span class="label label-danger">置顶</span>
                                    }
                                    <a class="title" href="/Group/SreachTopic/@item.ID">@item.TTITLE</a>
                                    @if (item.TATTRIBUTE != null && item.TATTRIBUTE.Contains("加精")) {
                                        <span class="label label-warning">精</span>
                                    }
                                </div>

                                <div class="metas">
                                    <a class="link-light link-muted" href="#">@item.Users.Uname</a>

                                    <span class="divider">•</span>
                                    @((DateTime.Now - item.TSTARTTIME).Minutes) 分钟前
                                </div>
                            </div>
                        </li>
                    </ul>
                }

            }
            else {
              <ul><li class="empty">暂无话题！</li></ul> 
            }


            <form id="user-group-form" class="form-horizontal" method="post" action="/Group/GroupCreate">
                <div class="form-group">
                    
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label" for="group_about">小组介绍</label>
                    <div class="col-md-7 controls">
                        <textarea name="GroupIntroduces" rows="10" id="group" class="form-control" data-image-upload-url="#"></textarea>
                    </div>
                </div>

                <div class="row">
                    <div class="col-md-7 col-md-offset-2">
                        <button id="group-save-btn" data-submiting-text="正在创建" type="submit" class="btn btn-primary">创建</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>